from api.model.user_llm_model import UserLLM
from api.vo.form.user_llm_form import UserLLMForm
from api.vo.ResponseVo import ResponseVo
import api.repository.user_llm_repository as user_llm_repository


def get_user_llm_by_user_id(user_id: str) -> ResponseVo:
    return ResponseVo(data=user_llm_repository.get_user_id(user_id=user_id))

def save_user_llm(user_value: UserLLMForm) -> ResponseVo:
    user_llm = UserLLM(
        chat_model=user_value.chatModel,
        embedding_model=user_value.embeddingModel,
        img2txt_model=user_value.img2txtModel,
        rerank_model=user_value.rerankModel,
        sequence2txt_model=user_value.sequence2txtModel,
        tts_model=user_value.ttsModel,
        user_id="123"
    )
    return ResponseVo(data=user_llm_repository.save(user_llm=user_llm))

